<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>js变量</title>
</head>
<body>
    
</body>
<script>
    //var声明变量,作用域全局
    var a = 3;
    a="six";
    console.log(a);
    var a= "sever" //可重复定义
    alert(a)
    //let声明变量作用域范围且不可重复定义
    {
        let x = 1
        alert(x)
    }
    alert(x+1)
    //const声明常量,无法范围
    const c = 9;
    c = 2;
    alert(c)
    
</script>
</html>